package com;

import java.util.ArrayList;
import java.util.List;


public class Test4 {
	
	public static void main(String[] args) {
//		System.out.println(2 << 2);
//		Hashtable<String, String> table = new Hashtable<String, String>();
//		table.put("", "");
//		float f = 3.4F;
//		System.out.println(f);
		
		
		List<Integer> results = new ArrayList<Integer>();
		for (int i = 0; i < 22; i++) {
			results.add(i);
		}
		int THREAD_FLAG = 5;
		int allStaffsCount = results.size();
		int taskCount = (int) (allStaffsCount / THREAD_FLAG);
		if (allStaffsCount % THREAD_FLAG != 0)
			taskCount += 1;
		for (int i = 1; i <= taskCount; i++) {
			List<Integer> resultStaffs = null;
			if (i == taskCount)
				resultStaffs = results.subList((i - 1) * THREAD_FLAG, allStaffsCount);
			else
				resultStaffs = results.subList((i - 1) * THREAD_FLAG, (i - 1) * THREAD_FLAG + THREAD_FLAG);
			
			System.out.println(resultStaffs.get(0) + " - " + resultStaffs.get(resultStaffs.size() - 1));
		}
		
	}
	
	public native static synchronized void test();
	
	private static class A{
		public void sayHello(){
			
		}
	}

} 
